package Homework01;

import java.util.ArrayList;
import java.util.Random;

public class ArrayList01 {
	public static void main(String[] args){
		Random r = new Random();
		int nextInt = r.nextInt(100);
		System.out.println(addRandom());
		print(addRandom());
	}
	public static ArrayList<Integer> addRandom(){
		ArrayList<Integer> list=new ArrayList<Integer>();
		Random r = new Random();
		for(int i=0;i<6;i++){
			list.add(r.nextInt(100));
			for(int j=0;j<i;j++){
				if(list.get(i) == list.get(j)){
					list.remove(i);
					i = i-1;
				}
			}
		}
		return list;
	}
	public static void print(ArrayList<Integer> list){
		System.out.print('{');
		for(int i=0;i<list.size();i++){
			System.out.print(list.get(i));
			if(i != list.size()-1){
				System.out.print('@');
			}
		}
		System.out.print('}');
		
		System.out.println();
	}
}
